/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modele;

import java.util.ArrayList;
import java.util.Collection;
import java.util.GregorianCalendar;
import metier.FinancialTransaction;

/**
 *
 * @author Alex
 */
public class Garage {
    protected Integer idGarage;
    protected String reference;
    protected String name;
    protected String address;
    protected String phoneNumber;
    protected String iban; /* Bank account id */
    protected Collection<Paiement> paiementsDone;

    public Garage(String reference, String name, String address,
            String phoneNumber, String iban) {
        this.reference = reference;
        this.name = name;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.iban = iban;
        this.paiementsDone = new ArrayList<>();
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getIdGarage() {
        return idGarage;
    }

    public void setIdGarage(Integer idGarage) {
        this.idGarage = idGarage;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public String getIban() {
        return iban;
    }

    public void setIban(String iban) {
        this.iban = iban;
    }

    public Collection<Paiement> getPaiementsDone() {
        return paiementsDone;
    }

    public void setPaiementsDone(Collection<Paiement> paiementsDone) {
        this.paiementsDone = paiementsDone;
    }

    public void addPaiement( Paiement paiement ) {
        paiementsDone.add(paiement);
        paiement.setStatus(Paiement.Status.DONE);
        paiement.setTransferDate(new GregorianCalendar());
    }
    
    public void delPaiement( Paiement paiement ) {
        paiementsDone.remove(paiement);
    }

    public String toString() {
        return "Reference : " + reference + "\nName : " + name + "\nAddress : " 
                + address + "\nPhone number : " + phoneNumber + "\nIban : "
                + iban;
    }
    
    
}
